home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / os2 / sysb091a.zip / sysbench / src / dhry.h < prev    next >
Text File  |  1995-12-31  |  18KB  |  441 lines

  1. /*
  2.  ****************************************************************************
  3.  *
  4.  *                   "DHRYSTONE" Benchmark Program
  5.  *                   -----------------------------
  6.  *
  7.  *  Version:    C, Version 2.1
  8.  *
  9.  *  File:       dhry.h (part 1 of 3)
  10.  *
  11.  *  Date:       May 25, 1988
  12.  *
  13.  *  Author:     Reinhold P. Weicker
  14.  *                      Siemens AG, E STE 35
  15.  *                      Postfach 3240
  16.  *                      8520 Erlangen
  17.  *                      Germany (West)
  18.  *                              Phone:  [xxx-49]-9131-7-20330
  19.  *                                      (8-17 Central European Time)
  20.  *                              Usenet: ..!mcvax!unido!estevax!weicker
  21.  *
  22.  *              Original Version (in Ada) published in
  23.  *              "Communications of the ACM" vol. 27., no. 10 (Oct. 1984),
  24.  *              pp. 1013 - 1030, together with the statistics
  25.  *              on which the distribution of statements etc. is based.
  26.  *
  27.  *              In this C version, the following C library functions are used:
  28.  *              - strcpy, strcmp (inside the measurement loop)
  29.  *              - printf, scanf (outside the measurement loop)
  30.  *              In addition, Berkeley UNIX system calls "times ()" or "time ()"
  31.  *              are used for execution time measurement. For measurements
  32.  *              on other systems, these calls have to be changed.
  33.  *
  34.  *  Collection of Results:
  35.  *              Reinhold Weicker (address see above) and
  36.  *
  37.  *              Rick Richardson
  38.  *              PC Research. Inc.
  39.  *              94 Apple Orchard Drive
  40.  *              Tinton Falls, NJ 07724
  41.  *                      Phone:  (201) 389-8963 (9-17 EST)
  42.  *                      Usenet: ...!uunet!pcrat!rick
  43.  *
  44.  *      Please send results to Rick Richardson and/or Reinhold Weicker.
  45.  *      Complete information should be given on hardware and software used.
  46.  *      Hardware information includes: Machine type, CPU, type and size
  47.  *      of caches; for microprocessors: clock frequency, memory speed
  48.  *      (number of wait states).
  49.  *      Software information includes: Compiler (and runtime library)
  50.  *      manufacturer and version, compilation switches, OS version.
  51.  *      The Operating System version may give an indication about the
  52.  *      compiler; Dhrystone itself performs no OS calls in the measurement loop.
  53.  *
  54.  *      The complete output generated by the program should be mailed
  55.  *      such that at least some checks for correctness can be made.
  56.  *
  57.  ***************************************************************************
  58.  *
  59.  *  History:    This version C/2.1 has been made for two reasons:
  60.  *
  61.  *              1) There is an obvious need for a common C version of
  62.  *              Dhrystone, since C is at present the most popular system
  63.  *              programming language for the class of processors
  64.  *              (microcomputers, minicomputers) where Dhrystone is used most.
  65.  *              There should be, as far as possible, only one C version of
  66.  *              Dhrystone such that results can be compared without
  67.  *              restrictions. In the past, the C versions distributed
  68.  *              by Rick Richardson (Version 1.1) and by Reinhold Weicker
  69.  *              had small (though not significant) differences.
  70.  *
  71.  *              2) As far as it is possible without changes to the Dhrystone
  72.  *              statistics, optimizing compilers should be prevented from
  73.  *              removing significant statements.
  74.  *
  75.  *              This C version has been developed in cooperation with
  76.  *              Rick Richardson (Tinton Falls, NJ), it incorporates many
  77.  *              ideas from the "Version 1.1" distributed previously by
  78.  *              him over the UNIX network Usenet.
  79.  *              I also thank Chaim Benedelac (National Semiconductor),
  80.  *              David Ditzel (SUN), Earl Killian and John Mashey (MIPS),
  81.  *              Alan Smith and Rafael Saavedra-Barrera (UC at Berkeley)
  82.  *              for their help with comments on earlier versions of the
  83.  *              benchmark.
  84.  *
  85.  *  Changes:    In the initialization part, this version follows mostly
  86.  *              Rick Richardson's version distributed via Usenet, not the
  87.  *              version distributed earlier via floppy disk by Reinhold Weicker.
  88.  *              As a concession to older compilers, names have been made
  89.  *              unique within the first 8 characters.
  90.  *              Inside the measurement loop, this version follows the
  91.  *              version previously distributed by Reinhold Weicker.
  92.  *
  93.  *              At several places in the benchmark, code has been added,
  94.  *              but within the measurement loop only in branches that
  95.  *              are not executed. The intention is that optimizing compilers
  96.  *              should be prevented from moving code out of the measurement
  97.  *              loop, or from removing code altogether. Since the statements
  98.  *              that are executed within the measurement loop have NOT been
  99.  *              changed, the numbers defining the "Dhrystone distribution"
  100.  *              (distribution of statements, operand types and locality)
  101.  *              still hold. Except for sophisticated optimizing compilers,
  102.  *              execution times for this version should be the same as
  103.  *              for previous versions.
  104.  *
  105.  *              Since it has proven difficult to subtract the time for the
  106.  *              measurement loop overhead in a correct way, the loop check
  107.  *              has been made a part of the benchmark. This does have
  108.  *              an impact - though a very minor one - on the distribution
  109.  *              statistics which have been updated for this version.
  110.  *
  111.  *              All changes within the measurement loop are described
  112.  *              and discussed in the companion paper "Rationale for
  113.  *              Dhrystone version 2".
  114.  *
  115.  *              Because of the self-imposed limitation that the order and
  116.  *              distribution of the executed statements should not be
  117.  *              changed, there are still cases where optimizing compilers
  118.  *              may not generate code for some statements. To a certain
  119.  *              degree, this is unavoidable for small synthetic benchmarks.
  120.  *              Users of the benchmark are advised to check code listings
  121.  *              whether code is generated for all statements of Dhrystone.
  122.  *
  123.  *              Version 2.1 is identical to version 2.0 distributed via
  124.  *              the UNIX network Usenet in March 1988 except that it corrects
  125.  *              some minor deficiencies that were found by users of version 2.0.
  126.  *              The only change within the measurement loop is that a
  127.  *              non-executed "else" part was added to the "if" statement in
  128.  *              Func_3, and a non-executed "else" part removed from Proc_3.
  129.  *
  130.  ***************************************************************************
  131.  *
  132.  * Defines:     The following "Defines" are possible:
  133.  *              -DREG=register          (default: Not defined)
  134.  *                      As an approximation to what an average C programmer
  135.  *                      might do, the "register" storage class is applied
  136.  *                      (if enabled by -DREG=register)
  137.  *                      - for local variables, if they are used (dynamically)
  138.  *                        five or more times
  139.  *                      - for parameters if they are used (dynamically)
  140.  *                        six or more times
  141.  *                      Note that an optimal "register" strategy is
  142.  *                      compiler-dependent, and that "register" declarations
  143.  *                      do not necessarily lead to faster execution.
  144.  *              -DNOSTRUCTASSIGN        (default: Not defined)
  145.  *                      Define if the C compiler does not support
  146.  *                      assignment of structures.
  147.  *              -DNOENUMS               (default: Not defined)
  148.  *                      Define if the C compiler does not support
  149.  *